package utils;

import cn.hutool.http.HttpUtil;

public class BlockChainUtils {
    //    public static long id = 1;
    public static String set(String id ,String sid,String base,String newBase){
        String body = "{\n" +
                "    \"groupId\" :1,\n" +
                "    \"signUserId\": \"c36bbc686df04c0fa47bfcf10d60bea2\",\n" +
                "    \"contractAbi\":[{\"constant\":true,\"inputs\":[{\"name\":\"id\",\"type\":\"string\"}],\"name\":\"get\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"},{\"name\":\"\",\"type\":\"string\"},{\"name\":\"\",\"type\":\"string\"},{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"sid\",\"type\":\"string\"},{\"name\":\"base\",\"type\":\"string\"},{\"name\":\"newbase\",\"type\":\"string\"}],\"name\":\"set\",\"outputs\":[{\"name\":\"\",\"type\":\"int256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"count\",\"type\":\"int256\"}],\"name\":\"SetResult\",\"type\":\"event\"}],\n" +
                "    \"contractAddress\":\"0x08973f1f06414fcc59751c8f77c905ac33da853b\",\n" +
                "    \"funcName\":\"set\",\n" +
                "    \"funcParam\":[\""+ id +"\",\""+ sid +"\",\"" + base +"\",\""+ newBase +"\"]\n" +
                "}";
        System.out.println(body);
        String url = "http://1.15.33.141:5002/WeBASE-Front/trans/handleWithSign";

        String res = HttpUtil.post(url,body);
        return res;

//        id ++;
    }

    public static void get(){}

}

